<template>
  <div>

    <el-table ref="table" :data="tableData3" style="width: 100%" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" />
      <el-table-column label="日期" width="120">
        <template scope="scope">{{ scope.row.date }}</template>
      </el-table-column>
      <el-table-column prop="name" empty-text="2132132" label="姓名" width="120" />
      <el-table-column prop="address" label="地址" show-overflow-tooltip />
    </el-table>
    <el-button type="primary" @click="checked()">ajax</el-button>
  </div>
</template>

<script>
// import x from ''
export default {
  name: 'Unnamed',
  components: {},
  props: {},
  data() {
    return {
      tableData3: [{
        date: '2016-05-03',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-04',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-01',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-08',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-06',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }, {
        date: '2016-05-07',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }],
      multipleSelection: []
    }
  },
  computed: {},
  watch: {},
  methods: {
    checked() {
      // 首先el-table添加ref="table"引用标识
      this.$refs.table.toggleAllSelection()
    },
    handleSelectionChange(val) {
      this.multipleSelection = val
    }
  }

}
</script>
<style scoped lang="scss">
</style>
